package mymac.com.test_3_1;

import android.app.Activity;
import android.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;

/**
 * Created by mymac on 2017/3/10.
 */

public class ShowView {
    private static ShowView showView;

    public static ShowView getInstance(){
        if(showView ==null){
            showView = new ShowView();
        }
        return showView;
    }
    public static void showView(Activity activity,int layout, ShowCallBack showCallBack){
        final AlertDialog builder = new AlertDialog.Builder(activity).create();
        LayoutInflater iInflater = LayoutInflater.from(activity);
        View v2 = iInflater.inflate(layout, null);
        builder.setView(v2);
        builder.show();
        Window window = builder.getWindow();
        window.setContentView(layout);
        showCallBack.showBuiler(window,builder);
    }
}
